﻿<%@ Page Language="C#" MasterPageFile="~/user.master" AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_Internet"
    Theme="default" Title="Report - Internet" CodeBehind="report-internet.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <link href="../rad-scripts/Grid.MyCustomSkin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
   
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>

    <div id="InnerDIVTOP" runat="server" visible="false">
    <div style="text-align: right; padding-right: 10px; padding-bottom: 10px;">
   

         <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="PnlAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllAdv" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllAdv_Clicked"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="PnlProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllProduct_Clicked"/>
                 </asp:Panel>
            </td>

            <td align="right">
             <asp:Panel runat="server" ID="pnlCategory"  Visible="false" >
            <span style="padding-left:10px;">Category :</span>
           <asp:Button ID="btnDownloadAll" runat="server" Text="Download All" 
                OnClick="btnDownloadAll_Clicked" />
                </asp:Panel>
                </td>

               
           <td align="right" style="width:15%;">
            <asp:Button ID="btnExport" runat="server" Text="Export" OnClick="btnExport_Clicked" />
            </td>
            </tr>
            </table>
    </div>
     <div style="text-align: center; padding: 10px; padding-bottom: 20px; border: none;">
            <asp:LinkButton ID="lnlBack" runat="server" Text="..Go back to summary.." OnClick="lnlBack_Clicked"
                Font-Size="16"></asp:LinkButton>
        </div>
    </div>
    
     <div id="SummaryDIVTOP" runat="server" visible="false">
        <div style="text-align: right; padding-right: 10px; padding-bottom: 5px;">
            
            <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="10%" align="left">
            <asp:Label ID="lblSummary" runat="server" Text="SUMMARY" ForeColor="#0066FF"   Font-Size="14"></asp:Label>
              </td>
       <td align="right" width="60%" >
            
              <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="pnlSummaryAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllSummaryAdvertiser" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllSummaryAdvertiser_Clicked"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="pnlSummaryProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllSummaryProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummaryProduct_Clicked"/>
                 </asp:Panel>
            </td>
            <td  align="right">
               <asp:Panel runat="server" ID="pnlSummaryCategory" Visible="false">
          <span style="padding-left:10px;">Category:</span>
            <asp:Button ID="btnDownloadAllSummary" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummary_Clicked" />
               </asp:Panel>
            </td>
            <td  align="right" style="width:25%;">
             <asp:Button ID="btnExportSummary" runat="server" Text="Export with Summary" OnClick="btnExportSummary_Clicked"/> 
            </td>
            </tr>
            </table>

        
             </td>
            </tr></table>
        </div>
       
    </div>
   
   <telerik:RadGrid ID="radGridAll" runat="server" AutoGenerateColumns="false" AllowSorting="True"
                GridLines="Both" PageSize="20" ItemStyle-Font-Size="7" EnableEmbeddedSkins="false"
                Skin="MyCustomSkin" EnableEmbeddedBaseStylesheet="False" OnNeedDataSource="radGridAll_NeedDataSource"
                OnItemCommand="radGridAll_ItemCommand" MasterTableView-AllowPaging="false">
                <MasterTableView Name="ReportAll" ItemStyle-BorderWidth="1" DataKeyNames="MediaType,CountRecord">
                    <AlternatingItemStyle Font-Size="Small" />
                    <ItemStyle Font-Size="Small" />
                  
                    <Columns>
                        <telerik:GridTemplateColumn ItemStyle-Width="20px" UniqueName="MediaType">
                            <ItemTemplate>
                                
                                <asp:Label ID="lblMTN" Text='<%#Eval("MediaType")%>' runat="server" Visible="false"></asp:Label>
                                <img src='../images/media/<%#Eval("MediaTypeName")%>.png' alt='<%#Eval("MediaTypeName")%>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn ItemStyle-Width="400" UniqueName="CountRecord" HeaderText="Media Total Records">
                            <ItemTemplate>
                                found <b>
                                    <%#Eval("CountRecord")%></b> records related to your search
                            </ItemTemplate>
                            <ItemStyle Font-Size="8" />
                        </telerik:GridTemplateColumn>
                          <telerik:GridBoundColumn DataField="InvestmentGrid" HeaderText="Total Investment" DataFormatString="{0:C0}"
                                ItemStyle-HorizontalAlign="Right" UniqueName="Investment"   />
                        <telerik:GridTemplateColumn ItemStyle-Width="235" UniqueName="Video" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkGetDetail" runat="server" CommandName="GetDetail" Text="Click for Details">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

          
           <asp:ObjectDataSource ID="objDSAll" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportInternet_Count" SelectCountMethod="GetReportInternet_RowCountTotal"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String" ConvertEmptyStringToNull="true" DefaultValue="" />
                    <asp:Parameter Name="sectorCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="subSector2Code" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="categoryCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>


           <div id="InnerDIV" runat="server" style="display:none;">
            <div style="display: none">
                <div style="float: left; text-align: left; padding: 10px; border: none;">
                    <table>
                        <tr>
                            <td>
                                <asp:LinkButton ID="lnkGrp_Adv" runat="server" Text="Group Advertiser" CommandArgument="AdvertiserName"
                                    OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="lnkGrp_Agnc" runat="server" Text="Group Agency" CommandArgument="AgencyName"
                                    OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="lnkGrp_Brnd" runat="server" Text="Group Brand" CommandArgument="BrandName"
                                    OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="lnkGrp_Prod" runat="server" Text="Group Product" CommandArgument="ProductName"
                                    OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="lnkGrp_Media" runat="server" Text="Group Media" CommandArgument="MediaName"
                                    OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="float: right; text-align: right; padding: 10px; border: none;">
                    <asp:LinkButton ID="lnkClearGroup" runat="server" Text="[Clear Grouping]" Visible="false"
                        OnClick="lnkClearGroup_Clicked"></asp:LinkButton>
                </div>
            </div>
           
            <br />
            <telerik:RadGrid ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
                AllowSorting="True" GridLines="Both" ShowGroupPanel="True" OnPreRender="radGrid_PreRender"
                PageSize="20" ItemStyle-Font-Size="8" EnableEmbeddedSkins="false" Skin="MyCustomSkin"
                PagerStyle-FirstPageText="First" PagerStyle-LastPageText="Last" PagerStyle-NextPageText="Next"
                PagerStyle-PrevPageText="Previous" PagerStyle-VerticalAlign="Middle" OnItemCommand="radGrid_ItemCommand"
                EnableEmbeddedBaseStylesheet="False" OnNeedDataSource="radGrid_NeedDataSource">

                   <ExportSettings ExportOnlyData="true" Excel-Format="ExcelML" IgnorePaging="true"
                    FileName="MediaMonitor-InternetReport">
                </ExportSettings>

                <MasterTableView Name="Report" ShowFooter="true" ItemStyle-BorderWidth="1" DataKeyNames="ProdVersionID, ProductID, Price,RFDate, MediaTypeCode, NewInternetFile">
                    <FooterStyle Font-Bold="true" ForeColor="AliceBlue" />
                    <GroupHeaderItemStyle Font-Bold="true" Font-Size="Larger" />
                    <AlternatingItemStyle Font-Size="Smaller" />
                    <ItemStyle Font-Size="Smaller" />
                    <Columns>
                        <telerik:GridBoundColumn DataField="RFDate" HtmlEncode="false" DataFormatString="{0:d}"
                            HeaderText="Date" UniqueName="RFDate" ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="MediaTypeName" HeaderText="Media" UniqueName="MediaType"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="MediaName" HeaderText="Media" UniqueName="Media"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="AgencyName" HeaderText="Agency" UniqueName="Agency"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="AdvertiserName" HeaderText="Advertiser" UniqueName="Advertiser"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="BrandName" HeaderText="Brand" UniqueName="Brand"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product" UniqueName="Product"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="ProdVersionName" HeaderText="Version" UniqueName="ProdVersion"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="ProgramName" HeaderText="Program" UniqueName="Program"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="SectorName" HeaderText="Sector" UniqueName="Sector"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="SubSectorName" HeaderText="Sub Sector" UniqueName="SubSector"
                            ItemStyle-Font-Size="7" />
                        <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Category" UniqueName="Category"
                            ItemStyle-Font-Size="7" />
                      <%--  <telerik:GridBoundColumn DataField="TimeStartFormatted" HeaderText="Start Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="STime" />
                        <telerik:GridBoundColumn DataField="TimeEndFormatted" HeaderText="End Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ETime" />--%>

                              <telerik:GridBoundColumn DataField="TimeStart" HeaderText="Start Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="STime" />
                        <telerik:GridBoundColumn DataField="TimeEnd" HeaderText="End Time" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ETime" />

                        <telerik:GridBoundColumn DataField="InternetBodyCode" HeaderText="InternetBody" ItemStyle-HorizontalAlign="Right"
                            UniqueName="InternetBodyCode" />

                              <telerik:GridBoundColumn DataField="InternetBodyName" HeaderText="Section" ItemStyle-HorizontalAlign="Right"
                            UniqueName="InternetBodyName" />

                        <telerik:GridBoundColumn DataField="ColorCode" HeaderText="ColorCode" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ColorCode" />
                              <telerik:GridBoundColumn DataField="ColorName" HeaderText="Color Ad" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ColorName" />
                        <telerik:GridBoundColumn DataField="ClassCode" HeaderText="Columns x Inches" ItemStyle-HorizontalAlign="Right"
                            UniqueName="ClassCode" />
                        <telerik:GridBoundColumn DataField="Wide" HeaderText="Columns" ItemStyle-HorizontalAlign="Right"
                            UniqueName="Wide" />
                        <telerik:GridBoundColumn DataField="Length" HeaderText="Inches" ItemStyle-HorizontalAlign="Right"
                            UniqueName="Length" />
                        <telerik:GridBoundColumn DataField="PageNumber" HeaderText="PageNumber" ItemStyle-HorizontalAlign="Right"
                            UniqueName="PageNumber" />
                        <telerik:GridBoundColumn DataField="RealCost" HeaderText="Investment" DataFormatString="{0:C0}"
                            ItemStyle-HorizontalAlign="Right" UniqueName="RealCost" />
                        <telerik:GridTemplateColumn HeaderText="Image" ItemStyle-Width="35" UniqueName="Image">
                            <ItemTemplate>
                                <!--for INTERNET-->
                                <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/internet.aspx?date=<%#Eval("RFDate").ToString().Replace("/", "_")%>&pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("NewInternetFile")%>', '_blank',750, 700); ">
                                    <span style='color: <%# Utility.ToStr(Eval("NewInternetFile"))!="" ? "green" : "red"%>;'>
                                        <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 9 &&  Utility.CheckInternetAvailability(Utility.ToStr(Eval("NewInternetFile")).ToString(),Utility.ToStr(Eval("RFDate")).ToString()), "Preview", "")%>
                                    </span></a>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Price" ItemStyle-HorizontalAlign="Center"
                            UniqueName="Cart">
                            <ItemTemplate>
                                <br />
                                <%# DataBinder.Eval(Container.DataItem, "Price", "<b>{0:C2}</b>")%><br />
                                <asp:LinkButton ID="lnkAdd2Cart" runat="server" CommandName="Add2Cart" CommandArgument='<%#Eval("ProdVersionCode")%>'>
                                   
                                   <%-- OnClientClick="return confirm('Are you sure to add this Internet  to Shopping Cart?')"--%>
                                <img src="../app_themes/default/buttons/cart-icon.png" alt="" />    
                                </asp:LinkButton>
                                <!-- add this attribute to above lnkAdd2Cart if u dont wanna show cart icon for unavailable videos
                                  Visible='%#Utility.CheckVideoAvailability(Eval("FullVideoFile").ToString())%>'> 

                            -->
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
            </telerik:RadGrid>
          </div>
          
            <asp:ObjectDataSource ID="objDS" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportInternet_Paged" SelectCountMethod="GetReportInternet_RowCount"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String" ConvertEmptyStringToNull="true" DefaultValue="" />
                    <asp:Parameter Name="sectorCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="subSector2Code" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="categoryCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>

             <asp:ObjectDataSource ID="objDSExport" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportInternet_Export" SelectCountMethod="GetReportInternet_RowCountExport"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_SelectingExport">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String" ConvertEmptyStringToNull="true" DefaultValue="" />
                    <asp:Parameter Name="sectorCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="subSector2Code" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="categoryCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean" ConvertEmptyStringToNull="true" DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>

            <!--do not remove the following btn, used to open the popup-->
            <asp:LinkButton ID="btnShowPop" runat="server" Width="1" Height="1" />
            <!--start modal-->
            <script type="text/javascript">


                function SetPostion2(obj, width, height) {

                    if (!obj)
                        return;

                    var left = parseInt((screen.availWidth / 2) - (width / 2));
                    var top = parseInt((screen.availHeight / 2) - (height));

                    var scrollTop = document.body.scrollTop;
                    if (scrollTop == 0) {
                        if (window.pageYOffset)
                            scrollTop = window.pageYOffset;
                        else
                            scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
                    }

                    obj.style.left = left + 'px';
                    obj.style.top = scrollTop + top + 'px';
                    //obj.style.width=width+'px';
                    //obj.style.height=height+'px';
                    obj.style.position = 'absolute';

                }

                function SetPositionBg2(obj) {
                    if (!obj)
                        return;

                    var left = 0;
                    var top = 0;

                    var scrollTop = document.body.scrollTop;
                    if (scrollTop == 0) {
                        if (window.pageYOffset)
                            scrollTop = window.pageYOffset;
                        else
                            scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
                    }

                    obj.style.left = left + 'px';
                    obj.style.top = scrollTop + top + 'px';
                    //obj.style.width=width+'px';
                    obj.style.height = scrollTop + screen.availHeight + 'px';
                    obj.style.position = 'absolute';

                }

                function AjaxLoading2(tbl, dv, bool) {
                    if (bool) {
                        SetPostion2(document.getElementById(tbl), 350, 200);
                        SetPositionBg2(document.getElementById(dv));
                        document.getElementById(tbl).style.display = 'block';
                        //document.getElementById('dvBg').style.display='block';
                    }
                    else {
                        document.getElementById(tbl).style.display = 'none';
                        //document.getElementById('dvBg').style.display='none';
                    }
                }

            </script>
            <!--warning-->
            <asp:Panel ID="pnl" runat="server" Visible="false">
                <asp:HiddenField ID="hdnPV" runat="server" Value="0" />
                 <asp:HiddenField ID="hdnRFDate" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPD" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPrice" runat="server" Value="0" />
                <asp:HiddenField ID="hdnInternetFile" runat="server" Value="" />
                <div id="dvBg2" style="display: block; width: 100%; height: 250%; text-align: center;
                    position: absolute; left: 0px; top: 0px;" class="GreyedOutCss">
                </div>
                <center>
                    <div id="dvWarning" style="border: solid 4px #ababab; padding: 20px; width: 350px;
                        height: 200px; background-color: White; z-index: 100; position: absolute; top: 400px;
                        left: 500px;">
                        <br />
                        <br />
                        <asp:Literal ID="ltrWarningOrderNum" runat="server" />
                        <br />
                        <br />
                        <asp:Button ID="btnCancel" runat="server" Text="Don't Purchase" OnClick="btnCancelPurchase_Clicked" />
                        <asp:Button ID="btnContinue" runat="server" Text="Continue with Purchase" OnClick="btnContinuePurchase_Clicked" />
                    </div>
                </center>
            </asp:Panel>
            <!--end warning-->
            </div>
            <!--end modal-->
        </ContentTemplate>
         <Triggers>
      
      <asp:PostBackTrigger ControlID="btnExport" />
         <asp:PostBackTrigger ControlID="btnDownloadAll" />

            <asp:PostBackTrigger ControlID="btnDownloadAllAdv" />
           <asp:PostBackTrigger ControlID="btnDownloadAllProduct" />

         <asp:PostBackTrigger ControlID="btnExportSummary" />
         <asp:PostBackTrigger ControlID="btnDownloadAllSummary" />

           <asp:PostBackTrigger ControlID="btnDownloadAllSummaryProduct" />
            <asp:PostBackTrigger ControlID="btnDownloadAllSummaryAdvertiser" />
         </Triggers>
    </asp:UpdatePanel>
    
</asp:Content>
